/*
 ***********************************************************************************************************************
 *
 *  Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved.
 *
 *  Permission is hereby granted, free of charge, to any person obtaining a copy
 *  of this software and associated documentation files (the "Software"), to deal
 *  in the Software without restriction, including without limitation the rights
 *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *  copies of the Software, and to permit persons to whom the Software is
 *  furnished to do so, subject to the following conditions:
 *
 *  The above copyright notice and this permission notice shall be included in all
 *  copies or substantial portions of the Software.
 *
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 *  SOFTWARE.
 *
 **********************************************************************************************************************/
/**
 ***********************************************************************************************************************
 * @file  vulkan.h
 * @brief Proxy to the real Khronos Vulkan header.
 ***********************************************************************************************************************
 */

#ifndef __VULKAN_H_PROXY__
#define __VULKAN_H_PROXY__

#include "vk_platform.h"

#if EXTERNAL_VULKAN_HEADERS
#include "vulkan/vulkan.h"
#else
#include "sdk-1.2/vulkan.h"
#endif

#ifdef VK_USE_PLATFORM_XLIB_KHR
#ifdef None
#undef None
#endif
#ifdef Success
#undef Success
#endif
#ifdef Always
#undef Always
#endif
#ifdef setbit
#undef setbit
#endif
#endif

// Internal (under development) extension definitions

#include "devext/vk_amd_gpa_interface.h"

#define VK_FORMAT_BEGIN_RANGE VK_FORMAT_UNDEFINED
#define VK_FORMAT_END_RANGE VK_FORMAT_ASTC_12x12_SRGB_BLOCK
#define VK_FORMAT_RANGE_SIZE (VK_FORMAT_ASTC_12x12_SRGB_BLOCK - VK_FORMAT_UNDEFINED + 1)

#define VK_IMAGE_TYPE_BEGIN_RANGE VK_IMAGE_TYPE_1D
#define VK_IMAGE_TYPE_END_RANGE VK_IMAGE_TYPE_3D
#define VK_IMAGE_TYPE_RANGE_SIZE (VK_IMAGE_TYPE_3D - VK_IMAGE_TYPE_1D + 1)

#define VK_IMAGE_TILING_BEGIN_RANGE VK_IMAGE_TILING_OPTIMAL
#define VK_IMAGE_TILING_END_RANGE VK_IMAGE_TILING_LINEAR
#define VK_IMAGE_TILING_RANGE_SIZE (VK_IMAGE_TILING_LINEAR - VK_IMAGE_TILING_OPTIMAL + 1)

#define VK_PHYSICAL_DEVICE_TYPE_BEGIN_RANGE VK_PHYSICAL_DEVICE_TYPE_OTHER
#define VK_PHYSICAL_DEVICE_TYPE_END_RANGE VK_PHYSICAL_DEVICE_TYPE_CPU

#define VK_QUERY_TYPE_BEGIN_RANGE VK_QUERY_TYPE_OCCLUSION
#define VK_QUERY_TYPE_END_RANGE VK_QUERY_TYPE_TIMESTAMP
#define VK_QUERY_TYPE_RANGE_SIZE (VK_QUERY_TYPE_TIMESTAMP - VK_QUERY_TYPE_OCCLUSION + 1)

#define VK_IMAGE_LAYOUT_RANGE_SIZE (VK_IMAGE_LAYOUT_PREINITIALIZED - VK_IMAGE_LAYOUT_UNDEFINED + 1)

#define VK_IMAGE_VIEW_TYPE_BEGIN_RANGE VK_IMAGE_VIEW_TYPE_1D
#define VK_IMAGE_VIEW_TYPE_END_RANGE VK_IMAGE_VIEW_TYPE_CUBE_ARRAY
#define VK_IMAGE_VIEW_TYPE_RANGE_SIZE (VK_IMAGE_VIEW_TYPE_CUBE_ARRAY - VK_IMAGE_VIEW_TYPE_1D + 1)

#define VK_COMPONENT_SWIZZLE_BEGIN_RANGE VK_COMPONENT_SWIZZLE_IDENTITY
#define VK_COMPONENT_SWIZZLE_END_RANGE VK_COMPONENT_SWIZZLE_A
#define VK_COMPONENT_SWIZZLE_RANGE_SIZE (VK_COMPONENT_SWIZZLE_A - VK_COMPONENT_SWIZZLE_IDENTITY + 1)

#define VK_PRIMITIVE_TOPOLOGY_BEGIN_RANGE VK_PRIMITIVE_TOPOLOGY_POINT_LIST
#define VK_PRIMITIVE_TOPOLOGY_END_RANGE VK_PRIMITIVE_TOPOLOGY_PATCH_LIST
#define VK_PRIMITIVE_TOPOLOGY_RANGE_SIZE (VK_PRIMITIVE_TOPOLOGY_PATCH_LIST - VK_PRIMITIVE_TOPOLOGY_POINT_LIST + 1)

#define VK_POLYGON_MODE_BEGIN_RANGE VK_POLYGON_MODE_FILL
#define VK_POLYGON_MODE_END_RANGE VK_POLYGON_MODE_POINT
#define VK_POLYGON_MODE_RANGE_SIZE (VK_POLYGON_MODE_POINT - VK_POLYGON_MODE_FILL + 1)

#define VK_FRONT_FACE_RANGE_SIZE (VK_FRONT_FACE_CLOCKWISE - VK_FRONT_FACE_COUNTER_CLOCKWISE + 1)

#define VK_COMPARE_OP_RANGE_SIZE (VK_COMPARE_OP_ALWAYS - VK_COMPARE_OP_NEVER + 1)

#define VK_STENCIL_OP_RANGE_SIZE (VK_STENCIL_OP_DECREMENT_AND_WRAP - VK_STENCIL_OP_KEEP + 1)

#define VK_LOGIC_OP_BEGIN_RANGE VK_LOGIC_OP_CLEAR
#define VK_LOGIC_OP_END_RANGE VK_LOGIC_OP_SET
#define VK_LOGIC_OP_RANGE_SIZE (VK_LOGIC_OP_SET - VK_LOGIC_OP_CLEAR + 1)

#define VK_BLEND_FACTOR_RANGE_SIZE (VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA - VK_BLEND_FACTOR_ZERO + 1)

#define VK_BLEND_OP_RANGE_SIZE (VK_BLEND_OP_MAX - VK_BLEND_OP_ADD + 1)

#define VK_DYNAMIC_STATE_RANGE_SIZE (VK_DYNAMIC_STATE_STENCIL_REFERENCE - VK_DYNAMIC_STATE_VIEWPORT + 1)

#define VK_SAMPLER_ADDRESS_MODE_BEGIN_RANGE VK_SAMPLER_ADDRESS_MODE_REPEAT
#define VK_SAMPLER_ADDRESS_MODE_END_RANGE VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER
#define VK_SAMPLER_ADDRESS_MODE_RANGE_SIZE (VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER - VK_SAMPLER_ADDRESS_MODE_REPEAT + 1)

#define VK_BORDER_COLOR_BEGIN_RANGE VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK
#define VK_BORDER_COLOR_END_RANGE VK_BORDER_COLOR_INT_OPAQUE_WHITE
#define VK_BORDER_COLOR_RANGE_SIZE (VK_BORDER_COLOR_INT_OPAQUE_WHITE - VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK + 1)

#define VK_PIPELINE_BIND_POINT_BEGIN_RANGE VK_PIPELINE_BIND_POINT_GRAPHICS
#define VK_PIPELINE_BIND_POINT_END_RANGE VK_PIPELINE_BIND_POINT_COMPUTE
#define VK_PIPELINE_BIND_POINT_RANGE_SIZE (VK_PIPELINE_BIND_POINT_COMPUTE - VK_PIPELINE_BIND_POINT_GRAPHICS + 1)

#define VK_INDEX_TYPE_BEGIN_RANGE VK_INDEX_TYPE_UINT16
#define VK_INDEX_TYPE_END_RANGE VK_INDEX_TYPE_UINT32
#define VK_INDEX_TYPE_RANGE_SIZE (VK_INDEX_TYPE_UINT32 - VK_INDEX_TYPE_UINT16 + 1)

#define VK_OBJECT_TYPE_BEGIN_RANGE VK_OBJECT_TYPE_UNKNOWN
#define VK_OBJECT_TYPE_END_RANGE VK_OBJECT_TYPE_COMMAND_POOL

#define VK_SAMPLER_REDUCTION_MODE_RANGE_SIZE \
    (VK_SAMPLER_REDUCTION_MODE_MAX - VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE + 1)

#define VK_PRESENT_MODE_RANGE_SIZE_KHR (VK_PRESENT_MODE_FIFO_RELAXED_KHR - VK_PRESENT_MODE_IMMEDIATE_KHR + 1)

#define VK_DEBUG_REPORT_OBJECT_TYPE_BEGIN_RANGE_EXT VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT
#define VK_DEBUG_REPORT_OBJECT_TYPE_END_RANGE_EXT VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT

#define VK_RASTERIZATION_ORDER_BEGIN_RANGE_AMD VK_RASTERIZATION_ORDER_STRICT_AMD
#define VK_RASTERIZATION_ORDER_END_RANGE_AMD VK_RASTERIZATION_ORDER_RELAXED_AMD

#define VK_CONSERVATIVE_RASTERIZATION_MODE_BEGIN_RANGE_EXT VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT
#define VK_CONSERVATIVE_RASTERIZATION_MODE_END_RANGE_EXT VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT

#endif
